#ifndef CBCALCKEYPAD_H_
#define CBCALCKEYPAD_H_

#include <mzfc_inc.h>
#include <string>
#include <vector>
#include "CBCalcUiEdit.h"

struct CBCalcButton {
    int             x, y, w, h;
    std::string     str;

    CBCalcButton(int x_, int y_, int w_, int h_, const char* s) :
        x(x_), y(y_), w(w_), h(h_), str(s) {}
};

class CBCalcKeyPad: public UiWin
{
private:
    CBCalcUiEdit*       m_uiedit;
    ImagingHelper       m_skinNormal;
    ImagingHelper       m_skinPressed;
    std::vector<CBCalcButton>   m_buttons;
    int                 m_currentButton;

public:
    CBCalcKeyPad();
    ~CBCalcKeyPad();
    void PaintWin(HDC hdcDst, RECT*  prcWin, RECT*  prcUpdate);
    int OnLButtonDown(UINT fwKeys, int xPos, int yPos);
    int OnLButtonUp(UINT fwKeys, int xPos, int yPos);
    void OnInit(CBCalcUiEdit* uiedit);

private:
    void LoadKeys(const CMzString& keysPath);
    int  FindButton(int x, int y);
    BOOL BitBlt(int x, int y, int w, int h, ImagingHelper& img);
};

#endif  /* CBCALCKEYPAD_H_    */
